package com.todo.member.infrastructure.repository;


import com.todo.member.common.enums.LevelRewardRecordStatusEnum;
import com.todo.member.infrastructure.entity.po.MemberLevelRewardRecordPO;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author azhebuxing
 * @date 2025/2/11 11:37
 * @description
 */
public interface MemberLevelRewardRecordRepository {

    /**
     * 插入会员等级奖励记录
     *
     * @param memberLevelRewardRecordPO
     * @return
     */
    Boolean insertMemberLevelRewardRecordPO(MemberLevelRewardRecordPO memberLevelRewardRecordPO);

    /**
     * 更新会员等级奖励记录
     *
     * @param memberLevelRewardRecordPO
     * @return
     */
    Boolean updateMemberLevelRewardRecordPOById(MemberLevelRewardRecordPO memberLevelRewardRecordPO);

    /**
     * 根据主键更新会员等级奖励记录状态
     *
     * @param id
     * @param oldStatus
     * @param newStatus
     * @return
     */
    Boolean updateMemberLevelRewardRecordStatusById(Long id, LevelRewardRecordStatusEnum oldStatus, LevelRewardRecordStatusEnum newStatus);

    /**
     * 根据用户ID查询会员等级奖励记录
     *
     * @param userId
     * @return
     */
    List<MemberLevelRewardRecordPO> queryMemberLevelRewardRecordPOByUser(@NotNull Long userId, String levelCode);

}
